﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BCDto.OA.TeamWorks.TaskRejectReplyRecord;
using BCService.OA.TeamWorks.TaskRejectReplyRecord;
using BlackCoffeeRESTful.Configs;
using Microsoft.AspNetCore.Mvc;

namespace BlackCoffeeRESTful.Controllers.Management.OA.Workflow.TaskRecord
{
    /// <summary>
    /// OA工作流任务驳回回复记录
    /// </summary>
    [ApiExplorerSettings(GroupName = "OAAdmin")]
    [Route("api/v1/sim/[controller]")]
    public class TaskRejectReplyRecordController : ManagementBaseController
    {
        private readonly ITaskRejectReplyRecordService taskRejectReplyRecordService;

        public TaskRejectReplyRecordController(ITaskRejectReplyRecordService taskRejectReplyRecordService)
        {
            this.taskRejectReplyRecordService = taskRejectReplyRecordService;
        }

        #region 添加驳回回复记录
        /// <summary>
        /// 添加驳回回复记录
        /// </summary>
        /// <param name="requestDto">驳回回复记录</param>
        /// <response code="201">添加驳回回复记录</response>
        /// <returns></returns>
        [HttpPost]
        [Log("添加驳回回复记录")]
        [ProducesResponseType(typeof(TaskRejectReplyRecordDto), 200)]
        public IActionResult Post([FromBody]TaskRejectReplyRecordRequestDto requestDto)
        {
            var result = this.taskRejectReplyRecordService.Add(requestDto);
            return Created(string.Format("api/v1/sim/TaskRejectReplyRecord/{0}", result.TaskRejectReplyRecordId), result);
        }
        #endregion
    }
}
